<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <link type="text/css" href="#{request.contextPath}/UI/epss/epss.css" rel="stylesheet"/>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
            function actSelect(obj,pageName) {
                var pkid=obj.toString();
                var strAfterSplit=pkid.split("|");
                var strType=strAfterSplit[0];
                var status_flag=strAfterSplit[1];
                var realPkid=strAfterSplit[2];
                var sfeature = "dialogwidth:1100px;dialogheight:600px;center:yes;location:no;help:no;resizable:no;scroll:no;status:no";
                var arg = new Object();
                arg.doType = "select";

                if (pageName=="dialog"){
                    if(strType=="0"){
                        if(status_flag=="")
                            var rtn =dialog("/epss/UI/epss/taskToView/tkctt/tkctt_TkcttMng.xhtml?strType="+strType+"&amp;strTkCttPkid="+realPkid+"",arg,sfeature);
                    }
                }
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <h:form id="form" enctype="multipart/form-data">
            <p:growl id="msgs" showDetail="true"/>
            <p:ajaxStatus style="width:16px;height:16px;">
                <f:facet name="start">
                    <h:graphicImage value="/images/ajaxloading.gif"/>
                </f:facet>
                <f:facet name="complete">
                    <h:outputText value=""/>
                </f:facet>
            </p:ajaxStatus>
            <p:contextMenu for="pdt">
                <p:menuitem value="详细内容" icon="ui-icon-search"
                            oncomplete="actSelect(DtItemTaskList.selection,'dialog')" >
                </p:menuitem>
            </p:contextMenu>
            <!--列表维护-->
            <p:dataTable id="pdt"
                         value="#{esInitTaskAction.itemTaskList}"
                         var="record"
                         rowKey="#{record.power_Pkid}"
                         selection="#{esInitTaskAction.itemTaskSelected}"
                         selectionMode="single"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks}
                         {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         paginator="true"
                         paginatorPosition="bottom"
                         rows="45"
                         rowIndexVar="row"
                         rowsPerPageTemplate="500,200,90,45,30,15"
                         emptyMessage="数据记录为空..."
                         widgetVar="DtItemTaskList"
                         rowStyleClass="#{record.name eq null?'rowDoneStyle':null}"
                         scrollable="true"
                         scrollHeight="470">
                <p:column headerText="任务类别" style="text-align:left;">
                    <h:outputText value="#{record.power_Type}" escape="false"/>
                </p:column>
                <!--<p:column headerText="待处理任务PKID" style="width:500px;text-align:left;">
                    <h:outputText value="#{record.power_Pkid}"/>
                </p:column>-->
                <p:column headerText="待处理任务" style="text-align:left;">
                    <h:outputText value="#{record.name}"/>
                </p:column>
                <p:column headerText="状态标志" style="width:100px;text-align:center;">
                    <h:outputText value="#{esFlowControl.getLabelByValueInStatusFlaglist(record.status_Flag)}"/>
                </p:column>
                <p:column headerText="原因" style="width:100px;text-align:right;">
                    <h:outputText value="#{esFlowControl.getLabelByValueInPreStatusFlaglist(record.pre_Status_Flag)}"/>
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>